<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>NGUI: Next-Gen UI kit: NGUIMath Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">NGUI: Next-Gen UI kit
   &#160;<span id="projectnumber">3.7.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_n_g_u_i_math.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Properties</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_n_g_u_i_math-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">NGUIMath Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Helper class containing generic functions used throughout the UI library.  
 <a href="class_n_g_u_i_math.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a818a5bd9645ba7d610315e9fd4609cc8"><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a818a5bd9645ba7d610315e9fd4609cc8">Lerp</a> (float from, float to, float factor)</td></tr>
<tr class="memdesc:a818a5bd9645ba7d610315e9fd4609cc8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lerp function that doesn't clamp the 'factor' in 0-1 range.  <a href="#a818a5bd9645ba7d610315e9fd4609cc8">More...</a><br /></td></tr>
<tr class="separator:a818a5bd9645ba7d610315e9fd4609cc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac262c277330500feadfde6252b8e53a6"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#ac262c277330500feadfde6252b8e53a6">ClampIndex</a> (int val, int max)</td></tr>
<tr class="memdesc:ac262c277330500feadfde6252b8e53a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clamp the specified integer to be between 0 and below 'max'.  <a href="#ac262c277330500feadfde6252b8e53a6">More...</a><br /></td></tr>
<tr class="separator:ac262c277330500feadfde6252b8e53a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a053692cab98997c88b02c058294e30b2"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a053692cab98997c88b02c058294e30b2">RepeatIndex</a> (int val, int max)</td></tr>
<tr class="memdesc:a053692cab98997c88b02c058294e30b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wrap the index using repeating logic, so that for example +1 past the end means index of '1'.  <a href="#a053692cab98997c88b02c058294e30b2">More...</a><br /></td></tr>
<tr class="separator:a053692cab98997c88b02c058294e30b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a024b86fe4218920b37f22c1940aba03f"><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a024b86fe4218920b37f22c1940aba03f">WrapAngle</a> (float angle)</td></tr>
<tr class="memdesc:a024b86fe4218920b37f22c1940aba03f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Ensure that the angle is within -180 to 180 range.  <a href="#a024b86fe4218920b37f22c1940aba03f">More...</a><br /></td></tr>
<tr class="separator:a024b86fe4218920b37f22c1940aba03f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19669e7a40cad5b906b472380e50398a"><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a19669e7a40cad5b906b472380e50398a">Wrap01</a> (float val)</td></tr>
<tr class="memdesc:a19669e7a40cad5b906b472380e50398a"><td class="mdescLeft">&#160;</td><td class="mdescRight">In the shader, equivalent function would be 'fract'  <a href="#a19669e7a40cad5b906b472380e50398a">More...</a><br /></td></tr>
<tr class="separator:a19669e7a40cad5b906b472380e50398a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7be9da2d0f73a8a497696f692ea454c"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#ae7be9da2d0f73a8a497696f692ea454c">HexToDecimal</a> (char ch)</td></tr>
<tr class="memdesc:ae7be9da2d0f73a8a497696f692ea454c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a hexadecimal character to its decimal value.  <a href="#ae7be9da2d0f73a8a497696f692ea454c">More...</a><br /></td></tr>
<tr class="separator:ae7be9da2d0f73a8a497696f692ea454c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1073cf52b1e29ec49948ad93c01d892b"><td class="memItemLeft" align="right" valign="top">static char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a1073cf52b1e29ec49948ad93c01d892b">DecimalToHexChar</a> (int num)</td></tr>
<tr class="memdesc:a1073cf52b1e29ec49948ad93c01d892b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a single 0-15 value into its hex representation. It's coded because int.ToString(format) syntax doesn't seem to be supported by Unity's Flash. It just silently crashes.  <a href="#a1073cf52b1e29ec49948ad93c01d892b">More...</a><br /></td></tr>
<tr class="separator:a1073cf52b1e29ec49948ad93c01d892b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5769101a3a4229297b42100273784fe9"><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a5769101a3a4229297b42100273784fe9">DecimalToHex8</a> (int num)</td></tr>
<tr class="memdesc:a5769101a3a4229297b42100273784fe9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a decimal value to its hex representation.  <a href="#a5769101a3a4229297b42100273784fe9">More...</a><br /></td></tr>
<tr class="separator:a5769101a3a4229297b42100273784fe9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0746a8048899cc1b9d49b17883929c04"><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a0746a8048899cc1b9d49b17883929c04">DecimalToHex24</a> (int num)</td></tr>
<tr class="memdesc:a0746a8048899cc1b9d49b17883929c04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a decimal value to its hex representation. It's coded because num.ToString("X6") syntax doesn't seem to be supported by Unity's Flash. It just silently crashes. string.Format("{0,6:X}", num).Replace(' ', '0') doesn't work either. It returns the format string, not the formatted value.  <a href="#a0746a8048899cc1b9d49b17883929c04">More...</a><br /></td></tr>
<tr class="separator:a0746a8048899cc1b9d49b17883929c04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a419a6e09048f9e5a5f1d3edcf8544c"><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a9a419a6e09048f9e5a5f1d3edcf8544c">DecimalToHex32</a> (int num)</td></tr>
<tr class="memdesc:a9a419a6e09048f9e5a5f1d3edcf8544c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a decimal value to its hex representation. It's coded because num.ToString("X6") syntax doesn't seem to be supported by Unity's Flash. It just silently crashes. string.Format("{0,6:X}", num).Replace(' ', '0') doesn't work either. It returns the format string, not the formatted value.  <a href="#a9a419a6e09048f9e5a5f1d3edcf8544c">More...</a><br /></td></tr>
<tr class="separator:a9a419a6e09048f9e5a5f1d3edcf8544c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b9dece36062116e85bebfa7eeda1376"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a2b9dece36062116e85bebfa7eeda1376">ColorToInt</a> (Color c)</td></tr>
<tr class="memdesc:a2b9dece36062116e85bebfa7eeda1376"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert the specified color to RGBA32 integer format.  <a href="#a2b9dece36062116e85bebfa7eeda1376">More...</a><br /></td></tr>
<tr class="separator:a2b9dece36062116e85bebfa7eeda1376"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af88f44df5756aa390ef8331540190426"><td class="memItemLeft" align="right" valign="top">static Color&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#af88f44df5756aa390ef8331540190426">IntToColor</a> (int val)</td></tr>
<tr class="memdesc:af88f44df5756aa390ef8331540190426"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert the specified RGBA32 integer to Color.  <a href="#af88f44df5756aa390ef8331540190426">More...</a><br /></td></tr>
<tr class="separator:af88f44df5756aa390ef8331540190426"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e06bdd8eeddc1253b0dc484fe3d5867"><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a6e06bdd8eeddc1253b0dc484fe3d5867">IntToBinary</a> (int val, int bits)</td></tr>
<tr class="memdesc:a6e06bdd8eeddc1253b0dc484fe3d5867"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert the specified integer to a human-readable string representing the binary value. Useful for debugging bytes.  <a href="#a6e06bdd8eeddc1253b0dc484fe3d5867">More...</a><br /></td></tr>
<tr class="separator:a6e06bdd8eeddc1253b0dc484fe3d5867"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0f4fbfbbc7c47d63a03a0efd1cb0067"><td class="memItemLeft" align="right" valign="top">static Color&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#ae0f4fbfbbc7c47d63a03a0efd1cb0067">HexToColor</a> (uint val)</td></tr>
<tr class="memdesc:ae0f4fbfbbc7c47d63a03a0efd1cb0067"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convenience conversion function, allowing hex format (0xRrGgBbAa).  <a href="#ae0f4fbfbbc7c47d63a03a0efd1cb0067">More...</a><br /></td></tr>
<tr class="separator:ae0f4fbfbbc7c47d63a03a0efd1cb0067"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acac521a80ff4bf6f9757d2bb7c5fc32d"><td class="memItemLeft" align="right" valign="top">static Rect&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#acac521a80ff4bf6f9757d2bb7c5fc32d">ConvertToTexCoords</a> (Rect rect, int width, int height)</td></tr>
<tr class="memdesc:acac521a80ff4bf6f9757d2bb7c5fc32d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert from top-left based pixel coordinates to bottom-left based UV coordinates.  <a href="#acac521a80ff4bf6f9757d2bb7c5fc32d">More...</a><br /></td></tr>
<tr class="separator:acac521a80ff4bf6f9757d2bb7c5fc32d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9b398234d756829f425c2b5982d2353"><td class="memItemLeft" align="right" valign="top">static Rect&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#af9b398234d756829f425c2b5982d2353">ConvertToPixels</a> (Rect rect, int width, int height, bool round)</td></tr>
<tr class="memdesc:af9b398234d756829f425c2b5982d2353"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert from bottom-left based UV coordinates to top-left based pixel coordinates.  <a href="#af9b398234d756829f425c2b5982d2353">More...</a><br /></td></tr>
<tr class="separator:af9b398234d756829f425c2b5982d2353"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0193ceab5302ad1c4e72e8f7bb44c083"><td class="memItemLeft" align="right" valign="top">static Rect&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a0193ceab5302ad1c4e72e8f7bb44c083">MakePixelPerfect</a> (Rect rect)</td></tr>
<tr class="memdesc:a0193ceab5302ad1c4e72e8f7bb44c083"><td class="mdescLeft">&#160;</td><td class="mdescRight">Round the pixel rectangle's dimensions.  <a href="#a0193ceab5302ad1c4e72e8f7bb44c083">More...</a><br /></td></tr>
<tr class="separator:a0193ceab5302ad1c4e72e8f7bb44c083"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa1f9aea15a53968a11cefb2be37d1e21"><td class="memItemLeft" align="right" valign="top">static Rect&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#aa1f9aea15a53968a11cefb2be37d1e21">MakePixelPerfect</a> (Rect rect, int width, int height)</td></tr>
<tr class="memdesc:aa1f9aea15a53968a11cefb2be37d1e21"><td class="mdescLeft">&#160;</td><td class="mdescRight">Round the texture coordinate rectangle's dimensions.  <a href="#aa1f9aea15a53968a11cefb2be37d1e21">More...</a><br /></td></tr>
<tr class="separator:aa1f9aea15a53968a11cefb2be37d1e21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07510fcfbabb8768b60621d32083b045"><td class="memItemLeft" align="right" valign="top">static Vector2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a07510fcfbabb8768b60621d32083b045">ConstrainRect</a> (Vector2 minRect, Vector2 maxRect, Vector2 minArea, Vector2 maxArea)</td></tr>
<tr class="memdesc:a07510fcfbabb8768b60621d32083b045"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constrain 'rect' to be within 'area' as much as possible, returning the Vector2 offset necessary for this to happen. This function is useful when trying to restrict one area (window) to always be within another (viewport).  <a href="#a07510fcfbabb8768b60621d32083b045">More...</a><br /></td></tr>
<tr class="separator:a07510fcfbabb8768b60621d32083b045"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acac5a5ac1c57a541131e42d60da46ad9"><td class="memItemLeft" align="right" valign="top">static Bounds&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#acac5a5ac1c57a541131e42d60da46ad9">CalculateAbsoluteWidgetBounds</a> (Transform trans)</td></tr>
<tr class="memdesc:acac5a5ac1c57a541131e42d60da46ad9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the combined bounds of all widgets attached to the specified game object or its children (in world space).  <a href="#acac5a5ac1c57a541131e42d60da46ad9">More...</a><br /></td></tr>
<tr class="separator:acac5a5ac1c57a541131e42d60da46ad9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab526cfc61a59334f96d9dca314129c68"><td class="memItemLeft" align="right" valign="top">static Bounds&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#ab526cfc61a59334f96d9dca314129c68">CalculateRelativeWidgetBounds</a> (Transform trans)</td></tr>
<tr class="memdesc:ab526cfc61a59334f96d9dca314129c68"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space).  <a href="#ab526cfc61a59334f96d9dca314129c68">More...</a><br /></td></tr>
<tr class="separator:ab526cfc61a59334f96d9dca314129c68"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9efc378e6a91ce205601f94f9bb26e53"><td class="memItemLeft" align="right" valign="top">static Bounds&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a9efc378e6a91ce205601f94f9bb26e53">CalculateRelativeWidgetBounds</a> (Transform trans, bool considerInactive)</td></tr>
<tr class="memdesc:a9efc378e6a91ce205601f94f9bb26e53"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space).  <a href="#a9efc378e6a91ce205601f94f9bb26e53">More...</a><br /></td></tr>
<tr class="separator:a9efc378e6a91ce205601f94f9bb26e53"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab42507c6819f9a874238b7431ab169dc"><td class="memItemLeft" align="right" valign="top">static Bounds&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#ab42507c6819f9a874238b7431ab169dc">CalculateRelativeWidgetBounds</a> (Transform relativeTo, Transform content)</td></tr>
<tr class="memdesc:ab42507c6819f9a874238b7431ab169dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space).  <a href="#ab42507c6819f9a874238b7431ab169dc">More...</a><br /></td></tr>
<tr class="separator:ab42507c6819f9a874238b7431ab169dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5b4c84ac5bc016248d940b5410b754c"><td class="memItemLeft" align="right" valign="top">static Bounds&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#af5b4c84ac5bc016248d940b5410b754c">CalculateRelativeWidgetBounds</a> (Transform relativeTo, Transform content, bool considerInactive)</td></tr>
<tr class="memdesc:af5b4c84ac5bc016248d940b5410b754c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space).  <a href="#af5b4c84ac5bc016248d940b5410b754c">More...</a><br /></td></tr>
<tr class="separator:af5b4c84ac5bc016248d940b5410b754c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa06ea0a858d51fbe288fe796a1210a0c"><td class="memItemLeft" align="right" valign="top">static Vector3&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#aa06ea0a858d51fbe288fe796a1210a0c">SpringDampen</a> (ref Vector3 velocity, float strength, float deltaTime)</td></tr>
<tr class="memdesc:aa06ea0a858d51fbe288fe796a1210a0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This code is not framerate-independent:  <a href="#aa06ea0a858d51fbe288fe796a1210a0c">More...</a><br /></td></tr>
<tr class="separator:aa06ea0a858d51fbe288fe796a1210a0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2378f127efd3ad43b2802c791c5fdb05"><td class="memItemLeft" align="right" valign="top">static Vector2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a2378f127efd3ad43b2802c791c5fdb05">SpringDampen</a> (ref Vector2 velocity, float strength, float deltaTime)</td></tr>
<tr class="memdesc:a2378f127efd3ad43b2802c791c5fdb05"><td class="mdescLeft">&#160;</td><td class="mdescRight">Same as the Vector3 version, it's a framerate-independent Lerp.  <a href="#a2378f127efd3ad43b2802c791c5fdb05">More...</a><br /></td></tr>
<tr class="separator:a2378f127efd3ad43b2802c791c5fdb05"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5341017f7d764b5d633ea2516b81c77f"><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a5341017f7d764b5d633ea2516b81c77f">SpringLerp</a> (float strength, float deltaTime)</td></tr>
<tr class="memdesc:a5341017f7d764b5d633ea2516b81c77f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate how much to interpolate by.  <a href="#a5341017f7d764b5d633ea2516b81c77f">More...</a><br /></td></tr>
<tr class="separator:a5341017f7d764b5d633ea2516b81c77f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1f6b9adadd325a1ac30b8f2ee915cf6"><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#ad1f6b9adadd325a1ac30b8f2ee915cf6">SpringLerp</a> (float from, float to, float strength, float deltaTime)</td></tr>
<tr class="memdesc:ad1f6b9adadd325a1ac30b8f2ee915cf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mathf.Lerp(from, to, Time.deltaTime * strength) is not framerate-independent. This function is.  <a href="#ad1f6b9adadd325a1ac30b8f2ee915cf6">More...</a><br /></td></tr>
<tr class="separator:ad1f6b9adadd325a1ac30b8f2ee915cf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95d627500bd6511b5d2449989b1a41c6"><td class="memItemLeft" align="right" valign="top">static Vector2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a95d627500bd6511b5d2449989b1a41c6">SpringLerp</a> (Vector2 from, Vector2 to, float strength, float deltaTime)</td></tr>
<tr class="memdesc:a95d627500bd6511b5d2449989b1a41c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Vector2.Lerp(from, to, Time.deltaTime * strength) is not framerate-independent. This function is.  <a href="#a95d627500bd6511b5d2449989b1a41c6">More...</a><br /></td></tr>
<tr class="separator:a95d627500bd6511b5d2449989b1a41c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8ecf9923dcea7b5eb8fd74b5f1fedd3"><td class="memItemLeft" align="right" valign="top">static Vector3&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#aa8ecf9923dcea7b5eb8fd74b5f1fedd3">SpringLerp</a> (Vector3 from, Vector3 to, float strength, float deltaTime)</td></tr>
<tr class="memdesc:aa8ecf9923dcea7b5eb8fd74b5f1fedd3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Vector3.Lerp(from, to, Time.deltaTime * strength) is not framerate-independent. This function is.  <a href="#aa8ecf9923dcea7b5eb8fd74b5f1fedd3">More...</a><br /></td></tr>
<tr class="separator:aa8ecf9923dcea7b5eb8fd74b5f1fedd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c9cb4f0f377b1285cfac368702d68bc"><td class="memItemLeft" align="right" valign="top">static Quaternion&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a9c9cb4f0f377b1285cfac368702d68bc">SpringLerp</a> (Quaternion from, Quaternion to, float strength, float deltaTime)</td></tr>
<tr class="memdesc:a9c9cb4f0f377b1285cfac368702d68bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quaternion.Slerp(from, to, Time.deltaTime * strength) is not framerate-independent. This function is.  <a href="#a9c9cb4f0f377b1285cfac368702d68bc">More...</a><br /></td></tr>
<tr class="separator:a9c9cb4f0f377b1285cfac368702d68bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5da9f1efef6c7aa0f5b8b280f2f77b97"><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a5da9f1efef6c7aa0f5b8b280f2f77b97">RotateTowards</a> (float from, float to, float maxAngle)</td></tr>
<tr class="memdesc:a5da9f1efef6c7aa0f5b8b280f2f77b97"><td class="mdescLeft">&#160;</td><td class="mdescRight">Since there is no Mathf.RotateTowards...  <a href="#a5da9f1efef6c7aa0f5b8b280f2f77b97">More...</a><br /></td></tr>
<tr class="separator:a5da9f1efef6c7aa0f5b8b280f2f77b97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70f1bf1bda7ff86fcf900aee67dbfecd"><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a70f1bf1bda7ff86fcf900aee67dbfecd">DistanceToRectangle</a> (Vector2[] screenPoints, Vector2 mousePos)</td></tr>
<tr class="memdesc:a70f1bf1bda7ff86fcf900aee67dbfecd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determine the distance from the mouse position to the screen space rectangle specified by the 4 points.  <a href="#a70f1bf1bda7ff86fcf900aee67dbfecd">More...</a><br /></td></tr>
<tr class="separator:a70f1bf1bda7ff86fcf900aee67dbfecd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3848ff937d33147ab7f1a1131b5d443c"><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a3848ff937d33147ab7f1a1131b5d443c">DistanceToRectangle</a> (Vector3[] worldPoints, Vector2 mousePos, Camera cam)</td></tr>
<tr class="memdesc:a3848ff937d33147ab7f1a1131b5d443c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determine the distance from the mouse position to the world rectangle specified by the 4 points.  <a href="#a3848ff937d33147ab7f1a1131b5d443c">More...</a><br /></td></tr>
<tr class="separator:a3848ff937d33147ab7f1a1131b5d443c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95411340876bf21366d7613d983e929c"><td class="memItemLeft" align="right" valign="top">static Vector2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a95411340876bf21366d7613d983e929c">GetPivotOffset</a> (<a class="el" href="class_u_i_widget.html#a596c5570fff0afa9f4c1930e0965fb22">UIWidget.Pivot</a> pv)</td></tr>
<tr class="memdesc:a95411340876bf21366d7613d983e929c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function that converts the widget's pivot enum into a 0-1 range vector.  <a href="#a95411340876bf21366d7613d983e929c">More...</a><br /></td></tr>
<tr class="separator:a95411340876bf21366d7613d983e929c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d638139dc061422968f975346e28c40"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_u_i_widget.html#a596c5570fff0afa9f4c1930e0965fb22">UIWidget.Pivot</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a7d638139dc061422968f975346e28c40">GetPivot</a> (Vector2 offset)</td></tr>
<tr class="memdesc:a7d638139dc061422968f975346e28c40"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function that converts the pivot offset to a pivot point.  <a href="#a7d638139dc061422968f975346e28c40">More...</a><br /></td></tr>
<tr class="separator:a7d638139dc061422968f975346e28c40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:addb667075ef4c752f1358a2cc7a157cd"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#addb667075ef4c752f1358a2cc7a157cd">MoveWidget</a> (<a class="el" href="class_u_i_rect.html">UIRect</a> w, float x, float y)</td></tr>
<tr class="memdesc:addb667075ef4c752f1358a2cc7a157cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust the widget's position using the specified local delta coordinates.  <a href="#addb667075ef4c752f1358a2cc7a157cd">More...</a><br /></td></tr>
<tr class="separator:addb667075ef4c752f1358a2cc7a157cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa875d2e71c7a2fb4f1d1020d1baca658"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#aa875d2e71c7a2fb4f1d1020d1baca658">MoveRect</a> (<a class="el" href="class_u_i_rect.html">UIRect</a> rect, float x, float y)</td></tr>
<tr class="memdesc:aa875d2e71c7a2fb4f1d1020d1baca658"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust the rectangle's position using the specified local delta coordinates.  <a href="#aa875d2e71c7a2fb4f1d1020d1baca658">More...</a><br /></td></tr>
<tr class="separator:aa875d2e71c7a2fb4f1d1020d1baca658"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c6347babae19da911d5278f0208bea2"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a3c6347babae19da911d5278f0208bea2">ResizeWidget</a> (<a class="el" href="class_u_i_widget.html">UIWidget</a> w, <a class="el" href="class_u_i_widget.html#a596c5570fff0afa9f4c1930e0965fb22">UIWidget.Pivot</a> pivot, float x, float y, int minWidth, int minHeight)</td></tr>
<tr class="memdesc:a3c6347babae19da911d5278f0208bea2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Given the specified dragged pivot point, adjust the widget's dimensions.  <a href="#a3c6347babae19da911d5278f0208bea2">More...</a><br /></td></tr>
<tr class="separator:a3c6347babae19da911d5278f0208bea2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24ff82516729f3ecd2127bc9d189d3bb"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a24ff82516729f3ecd2127bc9d189d3bb">ResizeWidget</a> (<a class="el" href="class_u_i_widget.html">UIWidget</a> w, <a class="el" href="class_u_i_widget.html#a596c5570fff0afa9f4c1930e0965fb22">UIWidget.Pivot</a> pivot, float x, float y, int minWidth, int minHeight, int maxWidth, int maxHeight)</td></tr>
<tr class="memdesc:a24ff82516729f3ecd2127bc9d189d3bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Given the specified dragged pivot point, adjust the widget's dimensions.  <a href="#a24ff82516729f3ecd2127bc9d189d3bb">More...</a><br /></td></tr>
<tr class="separator:a24ff82516729f3ecd2127bc9d189d3bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa3c0eb2fbae664464e6154971493db4"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#aaa3c0eb2fbae664464e6154971493db4">AdjustWidget</a> (<a class="el" href="class_u_i_widget.html">UIWidget</a> w, float left, float bottom, float right, float top)</td></tr>
<tr class="memdesc:aaa3c0eb2fbae664464e6154971493db4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust the widget's rectangle based on the specified modifier values.  <a href="#aaa3c0eb2fbae664464e6154971493db4">More...</a><br /></td></tr>
<tr class="separator:aaa3c0eb2fbae664464e6154971493db4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adba53abbba412ba6ce519a245d4265ea"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#adba53abbba412ba6ce519a245d4265ea">AdjustWidget</a> (<a class="el" href="class_u_i_widget.html">UIWidget</a> w, float left, float bottom, float right, float top, int minWidth, int minHeight)</td></tr>
<tr class="memdesc:adba53abbba412ba6ce519a245d4265ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust the widget's rectangle based on the specified modifier values.  <a href="#adba53abbba412ba6ce519a245d4265ea">More...</a><br /></td></tr>
<tr class="separator:adba53abbba412ba6ce519a245d4265ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a000cb9ea03c10972796dda20b6f02a30"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a000cb9ea03c10972796dda20b6f02a30">AdjustWidget</a> (<a class="el" href="class_u_i_widget.html">UIWidget</a> w, float left, float bottom, float right, float top, int minWidth, int minHeight, int maxWidth, int maxHeight)</td></tr>
<tr class="memdesc:a000cb9ea03c10972796dda20b6f02a30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust the widget's rectangle based on the specified modifier values.  <a href="#a000cb9ea03c10972796dda20b6f02a30">More...</a><br /></td></tr>
<tr class="separator:a000cb9ea03c10972796dda20b6f02a30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07f7694b13c63a894c8c5762200a6f6f"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a07f7694b13c63a894c8c5762200a6f6f">AdjustByDPI</a> (float height)</td></tr>
<tr class="memdesc:a07f7694b13c63a894c8c5762200a6f6f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust the specified value by DPI: height * 96 / DPI. This will result in in a smaller value returned for higher pixel density devices.  <a href="#a07f7694b13c63a894c8c5762200a6f6f">More...</a><br /></td></tr>
<tr class="separator:a07f7694b13c63a894c8c5762200a6f6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abfccd577ba64db39a26542df8142fe53"><td class="memItemLeft" align="right" valign="top">static Vector2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#abfccd577ba64db39a26542df8142fe53">ScreenToPixels</a> (Vector2 pos, Transform relativeTo)</td></tr>
<tr class="memdesc:abfccd577ba64db39a26542df8142fe53"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert the specified position, making it relative to the specified object.  <a href="#abfccd577ba64db39a26542df8142fe53">More...</a><br /></td></tr>
<tr class="separator:abfccd577ba64db39a26542df8142fe53"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ea0626a42b069ae164fc7075e893e16"><td class="memItemLeft" align="right" valign="top">static Vector2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a3ea0626a42b069ae164fc7075e893e16">ScreenToParentPixels</a> (Vector2 pos, Transform relativeTo)</td></tr>
<tr class="memdesc:a3ea0626a42b069ae164fc7075e893e16"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert the specified position, making it relative to the specified object's parent. Useful if you plan on positioning the widget using the specified value (think mouse cursor).  <a href="#a3ea0626a42b069ae164fc7075e893e16">More...</a><br /></td></tr>
<tr class="separator:a3ea0626a42b069ae164fc7075e893e16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d908f5e0567da39ff041df3363809df"><td class="memItemLeft" align="right" valign="top">static Vector3&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a0d908f5e0567da39ff041df3363809df">WorldToLocalPoint</a> (Vector3 worldPos, Camera worldCam, Camera uiCam, Transform relativeTo)</td></tr>
<tr class="memdesc:a0d908f5e0567da39ff041df3363809df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert the specified world point from one camera's world space to another, then make it relative to the specified transform. You should use this function if you want to position a widget using some 3D point in space. Pass your main camera for the "worldCam", and your UI camera for "uiCam", then the widget's transform for "relativeTo". You can then assign the widget's localPosition to the returned value.  <a href="#a0d908f5e0567da39ff041df3363809df">More...</a><br /></td></tr>
<tr class="separator:a0d908f5e0567da39ff041df3363809df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f7bc87d6bc536d4be409351a45052ce"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a9f7bc87d6bc536d4be409351a45052ce">OverlayPosition</a> (this Transform trans, Vector3 worldPos, Camera worldCam, Camera myCam)</td></tr>
<tr class="memdesc:a9f7bc87d6bc536d4be409351a45052ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function that can set the transform's position to be at the specified world position. Ideal usage: positioning a UI element to be directly over a 3D point in space.  <a href="#a9f7bc87d6bc536d4be409351a45052ce">More...</a><br /></td></tr>
<tr class="separator:a9f7bc87d6bc536d4be409351a45052ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2aead527b439db4340d6d209f631f9d5"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#a2aead527b439db4340d6d209f631f9d5">OverlayPosition</a> (this Transform trans, Vector3 worldPos, Camera worldCam)</td></tr>
<tr class="memdesc:a2aead527b439db4340d6d209f631f9d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function that can set the transform's position to be at the specified world position. Ideal usage: positioning a UI element to be directly over a 3D point in space.  <a href="#a2aead527b439db4340d6d209f631f9d5">More...</a><br /></td></tr>
<tr class="separator:a2aead527b439db4340d6d209f631f9d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1cfd5853d9857da830635868fa098cc"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_g_u_i_math.html#ab1cfd5853d9857da830635868fa098cc">OverlayPosition</a> (this Transform trans, Transform target)</td></tr>
<tr class="memdesc:ab1cfd5853d9857da830635868fa098cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function that can set the transform's position to be over the specified target transform. Ideal usage: positioning a UI element to be directly over a 3D object in space.  <a href="#ab1cfd5853d9857da830635868fa098cc">More...</a><br /></td></tr>
<tr class="separator:ab1cfd5853d9857da830635868fa098cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Helper class containing generic functions used throughout the UI library. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a07f7694b13c63a894c8c5762200a6f6f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int NGUIMath.AdjustByDPI </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>height</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Adjust the specified value by DPI: height * 96 / DPI. This will result in in a smaller value returned for higher pixel density devices. </p>

</div>
</div>
<a class="anchor" id="aaa3c0eb2fbae664464e6154971493db4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void NGUIMath.AdjustWidget </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_u_i_widget.html">UIWidget</a>&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>left</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>bottom</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>right</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>top</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Adjust the widget's rectangle based on the specified modifier values. </p>

</div>
</div>
<a class="anchor" id="adba53abbba412ba6ce519a245d4265ea"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void NGUIMath.AdjustWidget </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_u_i_widget.html">UIWidget</a>&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>left</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>bottom</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>right</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>top</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>minWidth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>minHeight</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Adjust the widget's rectangle based on the specified modifier values. </p>

</div>
</div>
<a class="anchor" id="a000cb9ea03c10972796dda20b6f02a30"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void NGUIMath.AdjustWidget </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_u_i_widget.html">UIWidget</a>&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>left</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>bottom</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>right</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>top</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>minWidth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>minHeight</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>maxWidth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>maxHeight</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Adjust the widget's rectangle based on the specified modifier values. </p>

</div>
</div>
<a class="anchor" id="acac5a5ac1c57a541131e42d60da46ad9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Bounds NGUIMath.CalculateAbsoluteWidgetBounds </td>
          <td>(</td>
          <td class="paramtype">Transform&#160;</td>
          <td class="paramname"><em>trans</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate the combined bounds of all widgets attached to the specified game object or its children (in world space). </p>

</div>
</div>
<a class="anchor" id="ab526cfc61a59334f96d9dca314129c68"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Bounds NGUIMath.CalculateRelativeWidgetBounds </td>
          <td>(</td>
          <td class="paramtype">Transform&#160;</td>
          <td class="paramname"><em>trans</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space). </p>

</div>
</div>
<a class="anchor" id="a9efc378e6a91ce205601f94f9bb26e53"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Bounds NGUIMath.CalculateRelativeWidgetBounds </td>
          <td>(</td>
          <td class="paramtype">Transform&#160;</td>
          <td class="paramname"><em>trans</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>considerInactive</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space). </p>

</div>
</div>
<a class="anchor" id="ab42507c6819f9a874238b7431ab169dc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Bounds NGUIMath.CalculateRelativeWidgetBounds </td>
          <td>(</td>
          <td class="paramtype">Transform&#160;</td>
          <td class="paramname"><em>relativeTo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Transform&#160;</td>
          <td class="paramname"><em>content</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space). </p>

</div>
</div>
<a class="anchor" id="af5b4c84ac5bc016248d940b5410b754c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Bounds NGUIMath.CalculateRelativeWidgetBounds </td>
          <td>(</td>
          <td class="paramtype">Transform&#160;</td>
          <td class="paramname"><em>relativeTo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Transform&#160;</td>
          <td class="paramname"><em>content</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>considerInactive</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space). </p>

</div>
</div>
<a class="anchor" id="ac262c277330500feadfde6252b8e53a6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int NGUIMath.ClampIndex </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>max</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Clamp the specified integer to be between 0 and below 'max'. </p>

</div>
</div>
<a class="anchor" id="a2b9dece36062116e85bebfa7eeda1376"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int NGUIMath.ColorToInt </td>
          <td>(</td>
          <td class="paramtype">Color&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert the specified color to RGBA32 integer format. </p>

</div>
</div>
<a class="anchor" id="a07510fcfbabb8768b60621d32083b045"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Vector2 NGUIMath.ConstrainRect </td>
          <td>(</td>
          <td class="paramtype">Vector2&#160;</td>
          <td class="paramname"><em>minRect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Vector2&#160;</td>
          <td class="paramname"><em>maxRect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Vector2&#160;</td>
          <td class="paramname"><em>minArea</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Vector2&#160;</td>
          <td class="paramname"><em>maxArea</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constrain 'rect' to be within 'area' as much as possible, returning the Vector2 offset necessary for this to happen. This function is useful when trying to restrict one area (window) to always be within another (viewport). </p>

</div>
</div>
<a class="anchor" id="af9b398234d756829f425c2b5982d2353"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Rect NGUIMath.ConvertToPixels </td>
          <td>(</td>
          <td class="paramtype">Rect&#160;</td>
          <td class="paramname"><em>rect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>round</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert from bottom-left based UV coordinates to top-left based pixel coordinates. </p>

</div>
</div>
<a class="anchor" id="acac521a80ff4bf6f9757d2bb7c5fc32d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Rect NGUIMath.ConvertToTexCoords </td>
          <td>(</td>
          <td class="paramtype">Rect&#160;</td>
          <td class="paramname"><em>rect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert from top-left based pixel coordinates to bottom-left based UV coordinates. </p>

</div>
</div>
<a class="anchor" id="a0746a8048899cc1b9d49b17883929c04"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static string NGUIMath.DecimalToHex24 </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert a decimal value to its hex representation. It's coded because num.ToString("X6") syntax doesn't seem to be supported by Unity's Flash. It just silently crashes. string.Format("{0,6:X}", num).Replace(' ', '0') doesn't work either. It returns the format string, not the formatted value. </p>

</div>
</div>
<a class="anchor" id="a9a419a6e09048f9e5a5f1d3edcf8544c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static string NGUIMath.DecimalToHex32 </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert a decimal value to its hex representation. It's coded because num.ToString("X6") syntax doesn't seem to be supported by Unity's Flash. It just silently crashes. string.Format("{0,6:X}", num).Replace(' ', '0') doesn't work either. It returns the format string, not the formatted value. </p>

</div>
</div>
<a class="anchor" id="a5769101a3a4229297b42100273784fe9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static string NGUIMath.DecimalToHex8 </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert a decimal value to its hex representation. </p>

</div>
</div>
<a class="anchor" id="a1073cf52b1e29ec49948ad93c01d892b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static char NGUIMath.DecimalToHexChar </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert a single 0-15 value into its hex representation. It's coded because int.ToString(format) syntax doesn't seem to be supported by Unity's Flash. It just silently crashes. </p>

</div>
</div>
<a class="anchor" id="a70f1bf1bda7ff86fcf900aee67dbfecd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static float NGUIMath.DistanceToRectangle </td>
          <td>(</td>
          <td class="paramtype">Vector2[]&#160;</td>
          <td class="paramname"><em>screenPoints</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Vector2&#160;</td>
          <td class="paramname"><em>mousePos</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Determine the distance from the mouse position to the screen space rectangle specified by the 4 points. </p>

</div>
</div>
<a class="anchor" id="a3848ff937d33147ab7f1a1131b5d443c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static float NGUIMath.DistanceToRectangle </td>
          <td>(</td>
          <td class="paramtype">Vector3[]&#160;</td>
          <td class="paramname"><em>worldPoints</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Vector2&#160;</td>
          <td class="paramname"><em>mousePos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Camera&#160;</td>
          <td class="paramname"><em>cam</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Determine the distance from the mouse position to the world rectangle specified by the 4 points. </p>

</div>
</div>
<a class="anchor" id="a7d638139dc061422968f975346e28c40"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="class_u_i_widget.html#a596c5570fff0afa9f4c1930e0965fb22">UIWidget.Pivot</a> NGUIMath.GetPivot </td>
          <td>(</td>
          <td class="paramtype">Vector2&#160;</td>
          <td class="paramname"><em>offset</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Helper function that converts the pivot offset to a pivot point. </p>

</div>
</div>
<a class="anchor" id="a95411340876bf21366d7613d983e929c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Vector2 NGUIMath.GetPivotOffset </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_u_i_widget.html#a596c5570fff0afa9f4c1930e0965fb22">UIWidget.Pivot</a>&#160;</td>
          <td class="paramname"><em>pv</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Helper function that converts the widget's pivot enum into a 0-1 range vector. </p>

</div>
</div>
<a class="anchor" id="ae0f4fbfbbc7c47d63a03a0efd1cb0067"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Color NGUIMath.HexToColor </td>
          <td>(</td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convenience conversion function, allowing hex format (0xRrGgBbAa). </p>

</div>
</div>
<a class="anchor" id="ae7be9da2d0f73a8a497696f692ea454c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int NGUIMath.HexToDecimal </td>
          <td>(</td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>ch</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert a hexadecimal character to its decimal value. </p>

</div>
</div>
<a class="anchor" id="a6e06bdd8eeddc1253b0dc484fe3d5867"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static string NGUIMath.IntToBinary </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>bits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert the specified integer to a human-readable string representing the binary value. Useful for debugging bytes. </p>

</div>
</div>
<a class="anchor" id="af88f44df5756aa390ef8331540190426"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Color NGUIMath.IntToColor </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert the specified RGBA32 integer to Color. </p>

</div>
</div>
<a class="anchor" id="a818a5bd9645ba7d610315e9fd4609cc8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static float NGUIMath.Lerp </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>factor</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Lerp function that doesn't clamp the 'factor' in 0-1 range. </p>

</div>
</div>
<a class="anchor" id="a0193ceab5302ad1c4e72e8f7bb44c083"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Rect NGUIMath.MakePixelPerfect </td>
          <td>(</td>
          <td class="paramtype">Rect&#160;</td>
          <td class="paramname"><em>rect</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Round the pixel rectangle's dimensions. </p>

</div>
</div>
<a class="anchor" id="aa1f9aea15a53968a11cefb2be37d1e21"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Rect NGUIMath.MakePixelPerfect </td>
          <td>(</td>
          <td class="paramtype">Rect&#160;</td>
          <td class="paramname"><em>rect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Round the texture coordinate rectangle's dimensions. </p>

</div>
</div>
<a class="anchor" id="aa875d2e71c7a2fb4f1d1020d1baca658"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void NGUIMath.MoveRect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_u_i_rect.html">UIRect</a>&#160;</td>
          <td class="paramname"><em>rect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Adjust the rectangle's position using the specified local delta coordinates. </p>

</div>
</div>
<a class="anchor" id="addb667075ef4c752f1358a2cc7a157cd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void NGUIMath.MoveWidget </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_u_i_rect.html">UIRect</a>&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Adjust the widget's position using the specified local delta coordinates. </p>

</div>
</div>
<a class="anchor" id="a9f7bc87d6bc536d4be409351a45052ce"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void NGUIMath.OverlayPosition </td>
          <td>(</td>
          <td class="paramtype">this Transform&#160;</td>
          <td class="paramname"><em>trans</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Vector3&#160;</td>
          <td class="paramname"><em>worldPos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Camera&#160;</td>
          <td class="paramname"><em>worldCam</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Camera&#160;</td>
          <td class="paramname"><em>myCam</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Helper function that can set the transform's position to be at the specified world position. Ideal usage: positioning a UI element to be directly over a 3D point in space. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">worldPos</td><td>World position, visible by the worldCam</td></tr>
    <tr><td class="paramname">worldCam</td><td>Camera that is able to see the worldPos</td></tr>
    <tr><td class="paramname">myCam</td><td>Camera that is able to see the transform this function is called on</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2aead527b439db4340d6d209f631f9d5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void NGUIMath.OverlayPosition </td>
          <td>(</td>
          <td class="paramtype">this Transform&#160;</td>
          <td class="paramname"><em>trans</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Vector3&#160;</td>
          <td class="paramname"><em>worldPos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Camera&#160;</td>
          <td class="paramname"><em>worldCam</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Helper function that can set the transform's position to be at the specified world position. Ideal usage: positioning a UI element to be directly over a 3D point in space. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">worldPos</td><td>World position, visible by the worldCam</td></tr>
    <tr><td class="paramname">worldCam</td><td>Camera that is able to see the worldPos</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ab1cfd5853d9857da830635868fa098cc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void NGUIMath.OverlayPosition </td>
          <td>(</td>
          <td class="paramtype">this Transform&#160;</td>
          <td class="paramname"><em>trans</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Transform&#160;</td>
          <td class="paramname"><em>target</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Helper function that can set the transform's position to be over the specified target transform. Ideal usage: positioning a UI element to be directly over a 3D object in space. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">target</td><td>Target over which the transform should be positioned</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a053692cab98997c88b02c058294e30b2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int NGUIMath.RepeatIndex </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>max</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Wrap the index using repeating logic, so that for example +1 past the end means index of '1'. </p>

</div>
</div>
<a class="anchor" id="a3c6347babae19da911d5278f0208bea2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void NGUIMath.ResizeWidget </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_u_i_widget.html">UIWidget</a>&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_u_i_widget.html#a596c5570fff0afa9f4c1930e0965fb22">UIWidget.Pivot</a>&#160;</td>
          <td class="paramname"><em>pivot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>minWidth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>minHeight</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Given the specified dragged pivot point, adjust the widget's dimensions. </p>

</div>
</div>
<a class="anchor" id="a24ff82516729f3ecd2127bc9d189d3bb"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void NGUIMath.ResizeWidget </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_u_i_widget.html">UIWidget</a>&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_u_i_widget.html#a596c5570fff0afa9f4c1930e0965fb22">UIWidget.Pivot</a>&#160;</td>
          <td class="paramname"><em>pivot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>minWidth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>minHeight</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>maxWidth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>maxHeight</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Given the specified dragged pivot point, adjust the widget's dimensions. </p>

</div>
</div>
<a class="anchor" id="a5da9f1efef6c7aa0f5b8b280f2f77b97"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static float NGUIMath.RotateTowards </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>maxAngle</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Since there is no Mathf.RotateTowards... </p>

</div>
</div>
<a class="anchor" id="a3ea0626a42b069ae164fc7075e893e16"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Vector2 NGUIMath.ScreenToParentPixels </td>
          <td>(</td>
          <td class="paramtype">Vector2&#160;</td>
          <td class="paramname"><em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Transform&#160;</td>
          <td class="paramname"><em>relativeTo</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert the specified position, making it relative to the specified object's parent. Useful if you plan on positioning the widget using the specified value (think mouse cursor). </p>

</div>
</div>
<a class="anchor" id="abfccd577ba64db39a26542df8142fe53"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Vector2 NGUIMath.ScreenToPixels </td>
          <td>(</td>
          <td class="paramtype">Vector2&#160;</td>
          <td class="paramname"><em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Transform&#160;</td>
          <td class="paramname"><em>relativeTo</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert the specified position, making it relative to the specified object. </p>

</div>
</div>
<a class="anchor" id="aa06ea0a858d51fbe288fe796a1210a0c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Vector3 NGUIMath.SpringDampen </td>
          <td>(</td>
          <td class="paramtype">ref Vector3&#160;</td>
          <td class="paramname"><em>velocity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>strength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>deltaTime</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>This code is not framerate-independent: </p>
<p>target.position += velocity; velocity = Vector3.Lerp(velocity, Vector3.zero, Time.deltaTime * 9f);</p>
<p>But this code is:</p>
<p>target.position += <a class="el" href="class_n_g_u_i_math.html#aa06ea0a858d51fbe288fe796a1210a0c" title="This code is not framerate-independent: ">NGUIMath.SpringDampen</a>(ref velocity, 9f, Time.deltaTime); </p>

</div>
</div>
<a class="anchor" id="a2378f127efd3ad43b2802c791c5fdb05"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Vector2 NGUIMath.SpringDampen </td>
          <td>(</td>
          <td class="paramtype">ref Vector2&#160;</td>
          <td class="paramname"><em>velocity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>strength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>deltaTime</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Same as the Vector3 version, it's a framerate-independent Lerp. </p>

</div>
</div>
<a class="anchor" id="a5341017f7d764b5d633ea2516b81c77f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static float NGUIMath.SpringLerp </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>strength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>deltaTime</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate how much to interpolate by. </p>

</div>
</div>
<a class="anchor" id="ad1f6b9adadd325a1ac30b8f2ee915cf6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static float NGUIMath.SpringLerp </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>strength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>deltaTime</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Mathf.Lerp(from, to, Time.deltaTime * strength) is not framerate-independent. This function is. </p>

</div>
</div>
<a class="anchor" id="a95d627500bd6511b5d2449989b1a41c6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Vector2 NGUIMath.SpringLerp </td>
          <td>(</td>
          <td class="paramtype">Vector2&#160;</td>
          <td class="paramname"><em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Vector2&#160;</td>
          <td class="paramname"><em>to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>strength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>deltaTime</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Vector2.Lerp(from, to, Time.deltaTime * strength) is not framerate-independent. This function is. </p>

</div>
</div>
<a class="anchor" id="aa8ecf9923dcea7b5eb8fd74b5f1fedd3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Vector3 NGUIMath.SpringLerp </td>
          <td>(</td>
          <td class="paramtype">Vector3&#160;</td>
          <td class="paramname"><em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Vector3&#160;</td>
          <td class="paramname"><em>to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>strength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>deltaTime</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Vector3.Lerp(from, to, Time.deltaTime * strength) is not framerate-independent. This function is. </p>

</div>
</div>
<a class="anchor" id="a9c9cb4f0f377b1285cfac368702d68bc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Quaternion NGUIMath.SpringLerp </td>
          <td>(</td>
          <td class="paramtype">Quaternion&#160;</td>
          <td class="paramname"><em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Quaternion&#160;</td>
          <td class="paramname"><em>to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>strength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>deltaTime</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Quaternion.Slerp(from, to, Time.deltaTime * strength) is not framerate-independent. This function is. </p>

</div>
</div>
<a class="anchor" id="a0d908f5e0567da39ff041df3363809df"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Vector3 NGUIMath.WorldToLocalPoint </td>
          <td>(</td>
          <td class="paramtype">Vector3&#160;</td>
          <td class="paramname"><em>worldPos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Camera&#160;</td>
          <td class="paramname"><em>worldCam</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Camera&#160;</td>
          <td class="paramname"><em>uiCam</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Transform&#160;</td>
          <td class="paramname"><em>relativeTo</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert the specified world point from one camera's world space to another, then make it relative to the specified transform. You should use this function if you want to position a widget using some 3D point in space. Pass your main camera for the "worldCam", and your UI camera for "uiCam", then the widget's transform for "relativeTo". You can then assign the widget's localPosition to the returned value. </p>

</div>
</div>
<a class="anchor" id="a19669e7a40cad5b906b472380e50398a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static float NGUIMath.Wrap01 </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>In the shader, equivalent function would be 'fract' </p>

</div>
</div>
<a class="anchor" id="a024b86fe4218920b37f22c1940aba03f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static float NGUIMath.WrapAngle </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>angle</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Ensure that the angle is within -180 to 180 range. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>D:/Projects/NGUI/Assets/NGUI/Scripts/Internal/<a class="el" href="_n_g_u_i_math_8cs.html">NGUIMath.cs</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_n_g_u_i_math.html">NGUIMath</a></li>
    <li class="footer">Generated on Sat Sep 13 2014 05:29:17 for NGUI: Next-Gen UI kit by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.8 </li>
  </ul>
</div>
</body>
</html>
